GraphicsGrid[Partition[Table[
ArrayPlot[Table[
If[MemberQ[IntegerDigits[x, 3]~Union~IntegerDigits[y,3],1], 0, 1],
{x, 0, 3^n-1}, {y, 0, 3^n-1}
]],
{n, 1, 6}
], 3]]